package com.example.newYear.observer;

public class ObserverPatternExample {

    public static void main(String[] args) {
        ConcreteSubject subject = new ConcreteSubject();

        ConcreteObserver observer1 = new ConcreteObserver("小王");
        ConcreteObserver observer2 = new ConcreteObserver("小李");

        subject.registerObserver(observer1);
        subject.registerObserver(observer2);

        subject.setMessage("Hello, Observers");
    }
}
